<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
<title>Example: To store text for pop-up windows in a text file</title>
<style>@import url(coUA.css);</style>
<link disabled rel="stylesheet" href="htmlhelp.css">
</HEAD>

<BODY>
<h1>Example: To store text for pop-up windows in a text file</h1>

<p>The text for pop-up windows can be stored in one text file with the .js file name extension. This enables you to store the text for all pop-up windows in your entire help system in a single location. This also enables you to globally define the font attributes to be used for pop-up windows.</p>

<ol>
<li>Create your pop-up windows using any text editor, in the following format:</p>

<p><code><i>popfont</i>=&quot;<i>Facename[, point size[, charset[, PLAIN BOLD ITALIC UNDERLINE]]]</i>&quot;<br>
<i>Text1</i>=&quot;<i>The text for the first pop-up window.</i>&quot;<br>
<i>Text2</i>=&quot;<i>The text for the second pop-up window.</i>&quot;<br>
</code></p>
<p>where <i>popfont</i> is the name of the variable that specifies the font attributes for the pop-up text and <i>Text1</i>, <i>Text2</i>, and so on, are the variables that specify the text of each pop-up window.</p>

<li>Save the file with a .js file name extension.</li>
<li>Copy the following code into each HTML file from which you want to open a pop-up window. Place the code between the <code>&lt;HEAD&gt;</code> start and end tags:

<p><code>&lt;OBJECT<br>
id=HHCTRL type=&quot;application/x-oleobject&quot;<br>
classid=&quot;clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11&quot;
&gt;<br>
&lt;/OBJECT&gt;<br>
<br>
&lt;SCRIPT language=javascript<br> SRC=&quot;terms.js&quot;&gt;<br>
&lt;/SCRIPT&gt;<br>
</code></p>

<p>where <i>HHCTRL</i> is the ID of the control that you are referencing, and <i>terms.js</i> is the name of your text file. You might want to include an error handler that is invoked if the specified text file cannot be found.</p>

<li>Also copy this code in your HTML file to call the TextPopup method of the HTML Help ActiveX control:

<p><code>&lt;A HREF=&quot;JavaScript:HHCTRL.TextPopup(Text1,popfont,9,9,-1,-1)&quot;<br>
Title=&quot;Click for pop-up definition&quot;&gt;Word to be defined&lt;/A&gt;
</code></p>
</li>
</ol>

<h3>Notes</h3>
<ul>
<li>You must add the text file to the <code>[FILES]</code> section of your project (.hhp) file.</li>

<li>This procedure cannot be used to create context-sensitive help topics that users open through an external program.</li>
</ul>


<br>
<table border="0" cellpadding="0" cellspacing="4">
<tr> 
<td valign="top"><a href="ocx_scripts.htm"><img src="home.gif" alt="link to overview topic" border="0"></a>
</td>
<td><a href="ocx_scripts.htm">About the script and DHTML examples</A>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

</BODY>
</HTML>
